package com.xyc.student.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xyc.student.controller.dto.UserPasswordDto;
import com.xyc.student.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author xyc
 * @since 2022-02-23
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Update("update sys_user set password = #{newPwd} where username = #{username} and password = #{pwd}")
    Integer updatePassword(UserPasswordDto dto);

    //获取用户总数
    @Select("select count(*) from sys_user ")
    Integer getUserCount();

    //获取文件总数
    @Select("select count(*) from sys_file ")
    Integer getFileCount();
}
